package com.yntsoft.util;

/**
 * 统一定义Memcached中存储的各种对象的Key前缀和超时时间.
 * 
 * @see com.yntsoft.service.AccountService#getInitializedUser(String)
 * 
 * 1小时过期 60 * 60 * 1
 * 
 * @author ynt
 */
public enum MemcachedObjectType {
	
	TASK("task:",60 * 30),
	
	TASK_VERSION("task_version:",60 * 30),
	
	TASK_PAGE("task_page:",60 * 60 * 1),
	
	TASK_PAGE_VERSION("task_page_version:",60 * 60 * 1 ),
	
	/***********************************************************************/
	
	USER("user:",60 * 60 * 1),
	
	/***********************************************************************/
	PERMISSION("permission",60*30),
	
	PERMISSION_VERSION("permission_version",60*30),
	
	PERMISSION_PAGE("permission_page",60*30),
	
	PERMISSION_PAGE_VERSION("permission_page_version",60*30);
	
	
	
	/**
	 * 前缀
	 */
	private String prefix;
	
	/**
	 * 超时时间
	 */
	private int expiredTime;

	MemcachedObjectType(String prefix, int expiredTime) {
		this.prefix = prefix;
		this.expiredTime = expiredTime;
	}

	public String getPrefix() {
		return prefix;
	}

	public int getExpiredTime() {
		return expiredTime;
	}

}
